 <table width="100%">
      <thead>
        <tr>
          <th>Indicador</th>
          <th>Año</th>
          <th>Mes</th>
          <th>Descripcion</th>
          <th>Valor real</th>
          <th>Objetivo</th>
          <th>Diferencia</th>
          <th>Estado</th>
          <th>Drilldown</th>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($reales as $real):?>
        <tr>
            <?php $objetivo = $real->getIndicador()->getObjetivo($real->getAno(), $real->getMes()) ?>
              <td><?php echo $real->getIndicador()->getNombre() ?></td>
              <td><?php echo $real->getAno() ?></td>
              <td><?php echo $real->getMes() ?></td>
              <td><?php echo $real->getIndicador()->getDescripcion() ?></td>
              <td><?php echo $real->getValor() ?></td>
            <?php if($objetivo == null){ ?>
              <td>No definido</td>
              <td> - </td>
              <td> - </td>
              <td> - </td>
            <?php } else { ?>
                <?php $diferencia = $real->getValor() - $objetivo->getValor() ?>
                <?php $relacion = $real->getIndicador()->getTipoRelacion() ?>

              <td><?php echo $objetivo->getValor() ?></td>
              <td><?php echo $diferencia ?></td>
              <?php if($real->getValor() > $objetivo->getValor()){?>
                  <?php if($relacion->getId() == 1) { ?>
                     <td>&nbsp;&nbsp;&nbsp;<?php echo image_tag('green')?></td>
                  <?php } else { ?>
                     <td>&nbsp;&nbsp;&nbsp;<?php echo image_tag('red')?></td>
                  <?php } ?>
                <?php } else { ?>
                  <?php if($relacion->getId() == 1) { ?>
                     <td>&nbsp;&nbsp;&nbsp;<?php echo image_tag('red')?></td>
                  <?php } else { ?>
                     <td>&nbsp;&nbsp;&nbsp;<?php echo image_tag('green')?></td>
                  <?php } ?>
                <?php } ?>
                 <?php if($real->getIndicador()->getFindrilldown() == false) {?>
                     <td><a href="<?php echo url_for('reales/show?indicador_id='.$real->getIndicador()->getId().'&ano='.$real->getAno().'&mes='.$real->getMes())?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo image_tag('/images/buttons/drilldown.png') ?></a></td>
                 <?php } else {?>
                     <td> - </td>
                 <?php }?>

              <?php } ?>

        </tr>
        <?php endforeach; ?>
      </tbody>
</table>
